import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { lotcaroperatelogVO, lotcaroperatelogForm, lotcaroperatelogQuery } from '@/api/access/parking-lot/parking-lot-car-operate-log/types';

/**
 * 查询停车场-车辆操作记录列表
 * @param query
 * @returns {*}
 */

export const listlotcaroperatelog = (query?: lotcaroperatelogQuery): AxiosPromise<lotcaroperatelogVO[]> => {
  return request({
    url: '/parkinglot/lotCarOperateLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场-车辆操作记录详细
 * @param parkingLotCarOperateLogId
 */
export const getlotcaroperatelog = (parkingLotCarOperateLogId: string | number): AxiosPromise<lotcaroperatelogVO> => {
  return request({
    url: '/parkinglot/lotCarOperateLog/' + parkingLotCarOperateLogId,
    method: 'get'
  });
};

/**
 * 新增停车场-车辆操作记录
 * @param data
 */
export const addlotcaroperatelog = (data: lotcaroperatelogForm) => {
  return request({
    url: '/parkinglot/lotCarOperateLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场-车辆操作记录
 * @param data
 */
export const updatelotcaroperatelog = (data: lotcaroperatelogForm) => {
  return request({
    url: '/parkinglot/lotCarOperateLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场-车辆操作记录
 * @param parkingLotCarOperateLogId
 */
export const dellotcaroperatelog = (parkingLotCarOperateLogId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotCarOperateLog/' + parkingLotCarOperateLogId,
    method: 'delete'
  });
};
